#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

using ll = long long;

int main() {
    ll n, p, q, x, y;
    cin >> n >> p >> q >> x >> y;
    string s;
    cin >> s;

    ll all = 0;
    for (char c : s) {
        if (c == '+') all++;
        else all--;
    }
    ll d = q - p;
    ll dt = d - all;
    ll m = abs(dt) / 2;

    ll ans = 1e18;
    vector<int> h(n + 2, 0);

    for (int k = 0; k < n; k++) {
        if (dt >= 0) {
            ll now = p;
            ll f = 0;
            ll minv = p;
            for (int i = 1; i <= n; i++) {
                int idx = n - k + i - 1;
                if (idx >= n) idx -= n;
                char c = s[idx];
                if (c == '+') {
                    now++;
                } else {
                    now--;
                    f++;
                }
                ll ci = min(m, f);
                ll v = now + 2 * ci;
                if (v < minv) minv = v;
            }
            if (minv >= 0) {
                ll cost = 1LL * k * y + 1LL * m * x;
                if (cost < ans) ans = cost;
            }
        } else {
            for (int i = 0; i <= n + 1; i++) h[i] = 0;
            for (int i = n - 1; i >= 0; i--) {
                int idx = n - k + i;
                if (idx >= n) idx -= n;
                h[i] = h[i + 1] + (s[idx] == '+' ? 1 : 0);
            }
            ll now = p;
            ll minv = now - 2 * m + 2 * min(m, (ll)h[0]);
            for (int i = 1; i <= n; i++) {
                int idx = n - k + i - 1;
                if (idx >= n) idx -= n;
                if (s[idx] == '+') {
                    now++;
                } else {
                    now--;
                }
                ll v = now - 2 * m + 2 * min(m, (ll)h[i]);
                if (v < minv) minv = v;
            }
            if (minv >= 0) {
                ll cost = 1LL * k * y + 1LL * m * x;
                if (cost < ans) ans = cost;
            }
        }
    }
    cout << ans << endl;
    return 0;
}